<?php

/**
 * Schedule form base class.
 *
 * @package    elearning
 * @subpackage form
 * @author     Your name here
 */
class BaseScheduleForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'             => new sfWidgetFormInputHidden(),
      'class_id'       => new sfWidgetFormPropelChoice(array('model' => 'Classes', 'add_empty' => false)),
      'weekdays_id'    => new sfWidgetFormPropelChoice(array('model' => 'Weekdays', 'add_empty' => false)),
      'start_day_time' => new sfWidgetFormTime(),
      'created_at'     => new sfWidgetFormDateTime(),
      'updated_at'     => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'             => new sfValidatorPropelChoice(array('model' => 'Schedule', 'column' => 'id', 'required' => false)),
      'class_id'       => new sfValidatorPropelChoice(array('model' => 'Classes', 'column' => 'id')),
      'weekdays_id'    => new sfValidatorPropelChoice(array('model' => 'Weekdays', 'column' => 'id')),
      'start_day_time' => new sfValidatorTime(),
      'created_at'     => new sfValidatorDateTime(array('required' => false)),
      'updated_at'     => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('schedule[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Schedule';
  }


}
